package com.stone.upms.upms.commons;

import lombok.Getter;
import lombok.Setter;

/**
 * 封装返回数据
 */
@Setter
@Getter
public class AjaxResult {

	private int retCode = 1;
	private String retMsg = "操作成功";
	private Object data;
	
	public AjaxResult(int retCode, String retMsg, Object data){
		this.retCode = retCode;
		this.retMsg = retMsg;
		this.data = data;
	}
	
	public AjaxResult(int retCode, String retMsg){
		this.retCode = retCode;
		this.retMsg = retMsg;
	}
	
	public AjaxResult(Object data){
		this.retMsg = "查询成功";
		this.data = data;
	}
	
	public AjaxResult(int retCode){
		this.retCode = retCode;
		this.retMsg = "操作失败";
	}
	
	public AjaxResult(String retMsg){
		this.retCode = 0;
		this.retMsg = retMsg;
	}
	
	public AjaxResult(){
		
	}


	@Override
	public String toString() {
		return "AjaxResult [retCode=" + retCode + ", retMsg=" + retMsg + ", data=" + data + "]";
	}
	
}
